import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2023-04-21
 * Time: 22:35
 */

public class Test15 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int s = gbc(n,2);
        System.out.println(n*2/s);
    }
    //辗转相除
    private static int gbc(int n, int i) {
       if(n == i){
           return n;
       }
       if(n < i){
           int tmp = n;
           n = i;
           i = tmp;
       }
       int r;
       while ((r = n%i) > 0){
           n = i;
           i = r;
       }
       return i;
    }
}
